import request from '@sutpc/axios';
import config from '@/global/config.js'
import {useUserStore} from '@/store/user';

/**
 * 获取图层树
 * @returns
 */
export function getJunctionFlow(code) {
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/global/getJunctionFlow?code=' + code,
    // 不显示loading
    loading: false
  });
} 
export function getJunctionEvent(type) {
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/global/getJunctionEvent?type=' + type,
    // 不显示loading
    loading: false
  });
} 
export function getEventList() {
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/global/getEventList',
    // 不显示loading
    loading: false
  });
} 
export function getDeviceStatistic() {
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/global/getDeviceStatistic',
    // 不显示loading
    loading: false
  });
} 
export function getExceptionAnalysis() {
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/global/getExceptionAnalysis',
    // 不显示loading
    loading: false
  });
}



// 感知对象
export function getTarget() {
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getTarget',
    // 不显示loading
    loading: false
  });
}
// 路口流量详情 东南西北方向
export function getJunctionFlows() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getJunctionFlows?code=' + code,
    // 不显示loading
    loading: false
  });
}
// 感知数量趋势
export function getJunctionIndexInfo() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getJunctionIndexInfo?type=&code=' + code,
    // 不显示loading
    loading: false
  });
}

// 路口实时事件
export function getJunctionEven(type) {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getJunctionEven?code=' + code + '&type=' + type,
    // 不显示loading
    loading: false
  });
}
// 路口通行效率
export function getJunctionStatistic() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getJunctionStatistic?code=' + code,
    // 不显示loading
    loading: false
  });
}
// 车流量统计
export function getCarFlowStatistic() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getCarFlowStatistic?code=' + code,
    // 不显示loading
    loading: false
  });
}
// 车辆总数折线图
export function getVehicleLine() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getVehicleLine?code=' + code,
    // 不显示loading
    loading: false
  });
}
// 实时上下游流量
export function getJunctionFlowIndex() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/index/getJunctionFlow?code=' + code,
    // 不显示loading
    loading: false
  });
}
// 2-link-车道流量分析
export function getFlowTop10() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/road/getFlowTop10',
    // 不显示loading
    loading: false
  });
}
// 2-link-车道流量分析
export function getRoadEvaluate(type) {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/road/getRoadEvaluate?type=' + type,
    // 不显示loading
    loading: false
  });
}
// 2-link-实时网恋车
export function getNetCarStatistic() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/road/getNetCarStatistic',
    // 不显示loading
    loading: false
  });
}
// 2-link-交通效率分析
export function getRoadIndex() {
  const code = useUserStore().getSearchValueId
  return request.get({
    url: config.apiTiannetBase + 'api/ps-show/road/getRoadIndex',
    // 不显示loading
    loading: false
  });
}